import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
// import axios from 'axios'
// import config from './config/index'
import request from './utils/request'
import storage from './utils/storage'
import api from './api/index'
import store from './store'
console.log('环境变量=>',
    import.meta.env)

const app = createApp(App)

// 测试mockApi
// axios.get(config.mockApi + '/products').then(res => console.log(res))

// 将封装的函数全部挂载到全局app.config.globalProperties上去，便于在各个组件内使用
// 使用方式就是this.$request/$storage/$api
app.config.globalProperties.$request = request
app.config.globalProperties.$storage = storage
app.config.globalProperties.$api = api
app.use(router).use(store).use(ElementPlus, {size: 'small'}).mount('#app')